#include <iostream>
using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    int n;

    cin >> n;
    for (int i = 2; i < n; i += 2) {
      cout << "-1 3 ";
    }
    if (n % 2 == 1) {
      cout << "-1\n";
    } else {
      cout << "-1 2\n";
    }
  }
  return 0;
}